export default function (func, wait = 300) {
    let last = 0
    return (...args) => {
        const now = +new Date()
        if (now - last > wait) {
            func(...args)
        }
        last = now
    }
}